<!--{eval $_TPL['titles'] = array('个人设置');}-->
<!--{template header_tpl}-->
<div class="grid_24 set_box">

	<form action="{SITEURL}setting/index" method="post" accept-charset="utf-8" id="usersetting">
		<div class="grid_24">
			<table class="formtable">
				<tr>
					<th style="width:30%;">登录名：</th>
					<td>{$userinfo[username]}</td>
				</tr>
				<tr>
					<th>头像：</th>
					<td>
						<div class="grid_5">
							<img src="{$userinfo[avatar]}"/><br/>
						</div>
						<div class="grid_2">
							<img src="{$userinfo[avatar_small]}"/>
							<br/>
							头像图标
						</div>
						<div class="grid_1"><a href="{SITEURL}setting/avatar">更新</a></div>
						<div class="clear"></div>
					</td>
				</tr>
				<tr>
					<th>真实姓名：</th>
					<td>
						<!--{if !$userinfo[namestatus]}-->
							<input id="name" type="text" value="{$userinfo[name]}" name="name" class="textinput" />
						<!--{else}-->
							<input id="name" type="text" value="{$userinfo[name]}(认证之后不能修改姓名)" name="name" class="textinput" disabled />
						<!--{/if}-->
					</td>
					<td>&nbsp;</td>
				</tr>
				<tr>
					<th>个人博客：</th>
					<td>
						<input id="myblog" type="text" value="{$userinfo[myblog]}" name="myblog" class="textinput" />
					</td>
					<td>&nbsp;</td>
				</tr>
				<tr>
					<th><p>一句话介绍：</p>
				      <p> 公司/职业，专业领域、兴趣爱好等</p></th>
					<td><textarea id="intro" value="" name="intro" class="areainput">{$userinfo[intro]}</textarea></td>
					<td>&nbsp;</td>
				</tr>
				<tr>
					<th><p>邮件提醒：</p>
				      <p> 定期的发送邮件提醒，避免您错过重要的信息</p>
					</th>
					<td>
						发送<input type="radio" name="mailnotice" value="1" <!--{if $userinfo[mailnotice]}--> checked<!--{/if}-->>
						取消<input type="radio" name="mailnotice" value="0" <!--{if !$userinfo[mailnotice]}--> checked<!--{/if}-->>
					</td>
				</tr>
				<tr>
					<td colspan="2">
						<div align="center">
						  <input type="hidden" name="formhash" value="<!--{eval echo formhash();}-->" />
						  <input type="submit" value="  保 存  " name="submitsetting">					
					  </div></td>
				</tr>
		  </table>
		</div>
	</form>
</div>



<script src="<!--{eval echo base_url();}-->resources/js/jquery.validate.min.js" type="text/javascript"></script>
<script src="<!--{eval echo base_url();}-->resources/js/validate.messages_cn.js" type="text/javascript"></script>
<script src="<!--{eval echo base_url();}-->resources/js/validate.additional-methods.min.js" type="text/javascript"></script>
<script src="<!--{eval echo base_url();}-->resources/js/jquery.form.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
	var validator = $("#usersetting").validate({
		onfocusout:false,
		errorElement:"span",
		rules: {
			name: {
				required: true,
				rangelength:[1,5] 
			},
			intro: {
				required: true,
				rangelength:[1,255]
			},
			myblog:{
				required: false,
				url: true
			}
		},
		messages: {
			name: {
				required: "请输入真实姓名",
				rangelength: $.validator.format("用户名长度 为{0} 到 {1} 汉字")
			},
			intro: {
				required: "请输入介绍",
				rangelength: $.validator.format("介绍长度 为{0} 到 {1} 汉字")
			},
			myblog:{
				url: "请填写正确的链接格式，以http://开始"
			}
		},
		errorPlacement: function(error, element) {
			error.appendTo(element.parent("td").next("td"));
		},
		highlight: function(element, errorClass) {
				$(element).fadeOut(function() {
				$(element).fadeIn();
			});
		},
		success: function(label) {
		}
	});
});
</script>
<!--{template footer_tpl}-->